#include "widget.h"
#include "clipboardmanager.h"

#include <QApplication>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    ClipboardManager cbm;
    Widget w(&cbm);

    QObject::connect (&cbm, SIGNAL(readyToSave(QString)),        &w, SLOT(readyToSave(QString)));
    QObject::connect (&cbm, SIGNAL(rawBufferChanged(QString)),   &w, SLOT(readyToPrepare(QString)));
    QObject::connect (&cbm, SIGNAL(preparedToTransfer(QString)), &w, SLOT(preparedToTransfer(QString)));
    QObject::connect (&cbm, SIGNAL(tooBigSize(QString)),         &w, SLOT(tooBigSize(QString)));
    QObject::connect (&cbm, SIGNAL(clearFields()),               &w, SLOT(clearFields()));

    QObject::connect (&w, SIGNAL(toPrepare()),                   &cbm, SLOT(prepareToTransfer()));

    w.show();
    return a.exec();
}
